package com.xayy.mgt.model;

import cn.kawins.mybatis.base.BaseModel;
import cn.kawins.mybatis.interceptor.FillingCreateTime;
import cn.kawins.mybatis.interceptor.InsertAutoFilling;
import cn.kawins.mybatis.interceptor.UpdateAutoFilling;
import cn.kawins.mybatis.util.SnowflakeId;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModelProperty;
import tk.mybatis.mapper.annotation.KeySql;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
import lombok.*;

/**
 * 功能项性能项健康度中每条记录所用参数中间表
 * @author Nie
 * @version V1.0
 * @date 2023/8/28 16:19
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "health_xw.bridge_param")
@EqualsAndHashCode(callSuper = true)
public class BridgeParam extends BaseModel<Long> {

    @Id
    @ApiModelProperty(value = "主键")
    @KeySql(genId = SnowflakeId.class)
    @JsonSerialize(using = ToStringSerializer.class)
    @Column(name = "id")
    private Long id;
    /**
     * 节点id
     */
    @ApiModelProperty(value = "功能项、性能项、健康度id")
    @Column(name = "parent_id")
    private Long parentId;
    /**
     * 指标名称
     */
    @ApiModelProperty(value = "功能项、性能项、健康度里面用到的关联参数、功能项、性能项id")
    @Column(name = "child_id")
    private Long childId;

    /**
     * 指标名称
     */
    @ApiModelProperty(value = "健康度配置所用是功能项还是性能项1：功能2：性能")
    @Column(name = "child_type")
    private Integer childType;

    /**
     * 指标名称
     */
    @ApiModelProperty(value = "这条记录是1：功能项、2：性能项、3：健康度")
    @Column(name = "type")
    private Integer type;

    /**
     * 创建时间
     */
    @Column(name = "created_time")
    @InsertAutoFilling(value = FillingCreateTime.class)
    @ApiModelProperty(value = "创建时间", accessMode = ApiModelProperty.AccessMode.READ_ONLY, example = "2010-01-01 00:00:00")
    private Date createdTime;
    /**
     * 更新时间
     */
    @Column(name = "updated_time")
    @UpdateAutoFilling(value = FillingCreateTime.class)
    @ApiModelProperty(value = "最后更新时间", accessMode = ApiModelProperty.AccessMode.READ_ONLY, example = "2010-01-01 00:00:00")
    private Date updatedTime;

}